#!/bin/bash

if [ -e "$BUILD_SRC/local/local_set.sh" ]; then
	source "$BUILD_SRC/local/local_set.sh"
fi

if [ -z $P4_PATH ]; then
	P4_PATH=`type -p p4`
fi

if [ $? -ne 0 ]; then
	echo "Failed to locate p4 command" && exit 1
fi

"$P4_PATH" login -s
if [ $? -ne 0 ]; then 
	echo Please login p4
	"$P4_PATH" login
fi

if [ $? -ne 0 ]; then 
	echo Perforce login failed && exit 1
fi

"$P4_PATH" sync $2/$3/...#head

